<html>
  <head>
    <meta charset="utf-8">
    <title>Mocha Tests</title>
    <link rel="stylesheet" href="../vendor/mocha/mocha.css" />
    <style>
      #main {
        display: none;
      }
    </style>
    <script src="../vendor/jquery.js"></script>
    <script src="../vendor/mocha/expect.js"></script>
    <script src="../vendor/mocha/mocha.js"></script>
    <script src="../vendor/mocha/helpers.js"></script>
    <script>
      /**
       * Set up a mock AMD define function for testing AMD registration.
       */
      function define(dependencies, callback) {
        // These libs behave like good AMD citizens, treat them that way.
        var moduleMap = {
          'jquery':     window.jQuery,
          'sammy':      window.Sammy,
          'mustache':   window.Mustache,
          'ejs':        window.EJS
        },
        modules = dependencies.map(function (modName) {
          return moduleMap[modName];
        });

        // Sammy is being defined
        if (dependencies.length == 1) {
          // this global var is the tested object in the AMD test
          window.amdDefined = callback(jQuery);
          window.Sammy = jQuery.sammy = window.amdDefined;
        } else {
          callback.apply(undefined, modules);
        }
      }
      define.amd = {
        jQuery: true
      };

      window.mocha.setup({
        ui: 'bdd',
        ignoreLeaks: true
      });
    </script>

    <script type="text/javascript" src="../vendor/templating/mustache.js"></script>
    <script type="text/javascript" src="../vendor/templating/ejs.js"></script>
    <script type="text/javascript" src="../vendor/templating/hogan.js"></script>
    <script type="text/javascript" src="../vendor/templating/handlebars.js"></script>
    <script type="text/javascript" src="../vendor/templating/pure.js"></script>
    <script type="text/javascript" src="../vendor/templating/haml.js"></script>
    <script type="text/javascript" src="../vendor/templating/tmpl.js"></script>

    <script src="../lib/sammy.js"></script>
    <script type="text/javascript" src="../lib/plugins/sammy.exceptional.js"></script>
    <script type="text/javascript" src="../lib/plugins/sammy.hoptoad.js"></script>
    <script type="text/javascript" src="../lib/plugins/sammy.flash.js"></script>
    <script type="text/javascript" src="../lib/plugins/sammy.template.js"></script>
    <script type="text/javascript" src="../lib/plugins/sammy.mustache.js"></script>
    <script type="text/javascript" src="../lib/plugins/sammy.meld.js"></script>
    <script type="text/javascript" src="../lib/plugins/sammy.data_location_proxy.js"></script>
    <script type="text/javascript" src="../lib/plugins/sammy.json.js"></script>
    <script type="text/javascript" src="../lib/plugins/sammy.storage.js"></script>
    <script type="text/javascript" src="../lib/plugins/sammy.cache.js"></script>
    <script type="text/javascript" src="../lib/plugins/sammy.ejs.js"></script>
    <script type="text/javascript" src="../lib/plugins/sammy.haml.js"></script>
    <script type="text/javascript" src="../lib/plugins/sammy.hogan.js"></script>
    <script type="text/javascript" src="../lib/plugins/sammy.handlebars.js"></script>
    <script type="text/javascript" src="../lib/plugins/sammy.pure.js"></script>
    <script type="text/javascript" src="../lib/plugins/sammy.tmpl.js"></script>
    <script type="text/javascript" src="../lib/plugins/sammy.nested_params.js"></script>
    <script type="text/javascript" src="../lib/plugins/sammy.form.js"></script>
    <script type="text/javascript" src="../lib/plugins/sammy.oauth2.js"></script>

    <script src="application_spec.js"></script>
    <script src="event_context_spec.js"></script>
    <script src="exceptional_spec.js"></script>
    <script src="flash_spec.js"></script>
    <script src="location_proxy_spec.js"></script>
    <script src="meld_spec.js"></script>
    <script src="render_context_spec.js"></script>
    <script src="storage_spec.js"></script>
    <script src="plugins_spec.js"></script>
    <script src="hoptoad_spec.js"></script>

    <script>
      $(function() {
        mocha.run();
      });
    </script>
  </head>
  <body>
    <div id="mocha"></div>
    <div id="main"></div>
    <div id="main2"></div>
  </body>
</html>
